<style>
/*订单显示*/
.item{ width:100px; height:185px; border:1px solid #ccc; padding:5px;border-radius:5px;float:left;margin:5px;}
.item .pic{width:100px;text-align:center;}
.item .pic img{max-width:80px; max-height:80px;border-radius:5px;}
.item .text{text-align:center;clear:both;}
.clear{clear:both;}
.mg10{margin:10px;}
.select-this{text-decoration:underline;font-size:14px;}
</style>

{include file="outgo/menu" /}

<div class="mg10">
<span class="layui-breadcrumb " lay-separator="|">
  <a href="{:url('over',['code' => $code, 't' => 1])}" class="{if condition="$t == 1"}select-this{/if}">今日</a>
  <a href="{:url('over',['code' => $code, 't' => 2])}" class="{if condition="$t == 2"}select-this{/if}">昨日</a>
  <a href="{:url('over',['code' => $code, 't' => 3])}" class="{if condition="$t == 3"}select-this{/if}">本周</a>
  <a href="{:url('over',['code' => $code, 't' => 4])}" class="{if condition="$t == 4"}select-this{/if}">上周</a>
  <a href="{:url('over',['code' => $code, 't' => 5])}" class="{if condition="$t == 5"}select-this{/if}">本月</a>
  <a href="{:url('over',['code' => $code, 't' => 6])}" class="{if condition="$t == 6"}select-this{/if}">上月</a>
</span>
</div>

<form class="layui-form">
<div id="view"><img src="/static/mp/image/loading.gif"></div>
</form>

<script id="tpl" type="text/html">
<div class="layui-collapse">
			
	{{#  if(d.list_orders > 0){ }}
		<div class="layui-colla-item list">
			<h2 class="layui-colla-title">订单列表 - <span id="orders" class="layui-badge">{{ d.list_orders }}</span>单 - <span id="items" class="layui-badge">{{ d.list_items }}</span>件</h2>
			<div class="layui-colla-content layui-show">
					
				{{#  layui.each(d.list, function(kkk, vvv){ }}
					<div class="item item-{{ vvv.client_ordernum }} layui-anim layui-anim-scaleSpring">
						<div class="pic"><img src="{{ vvv.pic }}"></div>
						<div class="text">{{ vvv.client_ordernum }}<br>
							{{ vvv.quantity_text }}<br>
							{{ vvv.outgo_over_time }}<br>
							{{ vvv.shipment_time }}<br>
							{{ vvv.factory_name }}<br>
						</div>
					</div>
				{{#  }); }}

				<div class="clear"></div>
			</div>
		</div>
	{{#  }else{ }}
	<div class="mg10"><i class="layui-icon layui-icon-face-cry red"></i>暂无数据</div>
	{{#  } }}

</div>
</script>

<script>
	layui.use([ 'element', 'layer', 'laytpl', 'form'], function() {
		var element = layui.element;
		var layer = layui.layer;
		var $ = layui.jquery;
		var form = layui.form;
		var laytpl = layui.laytpl;
		
     	// 获取订单
		getOrders();
		function getOrders(){
			$.ajax({
			   type: "POST",
			   url: "{:url('mp/outgo/over', ['code' => $code, 't' => $t])}",
			   data: "",
			   dataType:"json",
			   success: function(res){
				   var Tpl = $('#tpl').html();
				   laytpl(Tpl).render(res.data, function(html){
				   		$('#view').html(html);
				   });
				   
				   element.init();
			   }
			});
		}		
	});
</script>